<?php
/*
 * 手机客户端艺术-艺术首页
 * 2014-06-06
 */
include "../inc/public_header.php";

$reJson = array(); //构建返回值
/*
 * 常量
 */

$img_artPath = "http://www.chinalaohu.com/images/app/art/art/";
$img_collegePath = "http://www.chinalaohu.com/images/app/art/college/";
$img_competitionPath = "http://www.chinalaohu.com/images/app/art/competition/";

$reJson["success"] = "1";

//一起来艺术
$artArr = array(
	"hdId"=>"1"			
	,"title"=>"一起来艺术"
	,"imgUrl"=>$img_artPath."art.png"
	,"wapUrl"=>""
);
$reJson["art"] = $artArr;

//学校作品
$count = "8";	

$collegeArr[] = array(
	"cid"=>"28"			
	,"cname"=>"上海理工大学版艺学院创业者之家"
	,"cimgUrl"=>$img_collegePath."28.png"
	,"hdId"=>"1"
);
$collegeArr[] = array(
	"cid"=>"13"			
	,"cname"=>"中国美术学院张江校区"
	,"cimgUrl"=>$img_collegePath."13.png"
	,"hdId"=>"1"
);
$collegeArr[] = array(
	"cid"=>"12"			
	,"cname"=>"上海大学美术学院"
	,"cimgUrl"=>$img_collegePath."12.png"
	,"hdId"=>"1"
);
$collegeArr[] = array(
	"cid"=>"11"			
	,"cname"=>"景德镇陶瓷学院"
	,"cimgUrl"=>$img_collegePath."11.png"
	,"hdId"=>"1"
);
$collegeArr[] = array(
	"cid"=>"32"			
	,"cname"=>"广东白云学院"
	,"cimgUrl"=>$img_collegePath."32.png"
	,"hdId"=>"1"
);
$collegeArr[] = array(
	"cid"=>"29"			
	,"cname"=>"复旦大学"
	,"cimgUrl"=>$img_collegePath."29.png"
	,"hdId"=>"1"
);
$collegeArr[] = array(
	"cid"=>"36"			
	,"cname"=>"东华大学"
	,"cimgUrl"=>$img_collegePath."36.png"
	,"hdId"=>"1"
);
$collegeArr[] = array(
	"cid"=>"37"			
	,"cname"=>"上海应用技术学院"
	,"cimgUrl"=>$img_collegePath."37.png"
	,"hdId"=>"1"
);
$college = array("count"=>$count,"list"=>$collegeArr);	
$reJson["college"] = $college;

//大赛
$hasMore = "0";
$sql = "SELECT id,aname,DATE(stime) as stime,DATE(etime) as etime,hdtype FROM `new_weituo_huodong` where state=1 and dasai=1"; 
$db->query($sql);
$competitionArr = array();
while($db->next_record()){
	$competitionArr[] = array(
		"hdId"=>$db->f("id")
		,"title"=>$db->f("aname")
		,"imgUrl"=>$img_competitionPath.$db->f("id").".png"				
		,"startTime"=>$db->f("stime")	
		,"endTime"=>$db->f("etime")
		,"hdType"=>$db->f("hdtype")
		,"wapUrl"=>""
	);
}
		
$competition = array("hasMore"=>$hasMore,"list"=>$competitionArr);	
$reJson["competition"] = $competition;
echo json_encode($reJson);
die;
?>
